/ Assembly List / LJCNetCommon / NetCommon / GetBoolean

Namespace - LJCNetCommon


Parameters
value - The value object.

Returns

The boolean value or false if the object is null. Also returns false if the object is not type "bool".

Syntax

C#
public static Boolean GetBoolean(Object value)

Gets a boolean value from an object.

Example

C#
using LJCNetCommon;
        
// Gets a bool value from an object.
private static void GetBoolean()
{
    // Simulates an Object value like that received from a DataTable.
    bool setup = true;
    object obj = setup;

    // Gets a short value from an object.
    var result = NetCommon.GetBoolean(obj);

    result:
    // True
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.